{config_load file="_order_service.conf" section="`$lang`"}

{*
{$Staff->getSubscrData()}
{$Staff->subscrDaysLeft}
{$Staff->wasOnTrial()}
*}

{if $lang=="en"}
	{assign var="curr_pre" value=#_order_service__labelCurrency#}
	{assign var="curr_post" value=""}
{else}
	{assign var="curr_pre" value=""}
	{assign var="curr_post" value=#_order_service__labelCurrency#}
{/if}


{if $smarty.get.s=='' && !$Staff->Login()}
<script type="text/javascript">
 {literal}
        window.location="index.php?p=rates&s=trial";
 {/literal}
 </script>
 {/if}
 {if !$smarty.get.s && $Staff->Login()}
 <script type="text/javascript">
 {literal}
        window.location="index.php?p=rates&s=subscribe";
 {/literal}
 </script>
 {/if}

{$Order->setUser($Staff->UserID())}
{$Order->setSubscr($Staff->checkSubscribed())}
{$Order->setTrial($Staff->isTrialFinished())}

 <table class="bammerTable">
 <tr>
	<td align="left" valign="top">

	 <table border="0" width="100%" >
 		<tr>
			<td width="146" height="27" >&nbsp;</td>
			<td width="152" colspan="2" class="banGraySmall"><nobr><b>{#_order_service__labelSpecOffer#}{*SPECIAL OFFER*}</b></nobr></td>
			<!--<td colspan="2" align="right" style="font-size: 10pt" class="banGreen">OFFER ENDS: Friday, Aug 3, 2007 &nbsp;&nbsp;</td>-->
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td colspan="2" class="banMiddle1" height="72" valign="middle"><span class="banMiddle2">{#_order_service__labelSignUp#}{*Sign up today and get*}</span><br><span class="banGreenBig" style="padding-top: 0px">{#_order_service__label2Month#}{*two months*}</span> {#_order_service__labelPrice#}{*for the price of*} <span class="banGreenBig">{#_order_service__labelOne#}{*one*}</span></td>
			<td></td>
		</tr>

		<tr>
			<td>&nbsp;</td>
			<td valign="top" width="80" class="banWhite"><nobr><b>{#_order_service__labelStndartRate#}{*Standard rate:*}</b></nobr><br><nobr><span class="banNum">$129,95</span> <span class="banThrough">{#_order_service__labelPerMonth#}{*per month*}</span>&nbsp;&nbsp;&nbsp;&nbsp;</nobr></td>
			<td valign="top"  class="banWhite"><nobr><b>{#_order_service__labelDiscount#}{*Discounted rate:*}</b></nobr><br><nobr><span class="banGreenNum">$129,95</span><span class="banGreenSmall"> {#_order_service__labelPer2Month#} {*per 2 months*}</span></nobr></td>
			<td></td>
		</tr>
 	</table>

	</td>
 </tr>
 </table>



   <h3 style="margin-bottom: 5px; margin-top: 0px">{#_order_service__labelReceive#}{*All Subscribers Receive:*}</h3>
   <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-bottom: 0px"><tr><td class="dottedLine"><img src="images/spacer.gif" /></td></tr></table>

   <table width="90%">
  	<tr>
		<td valign="top"><img src="images/arrow_orange.gif" vspace="2" align="top" />&nbsp;</td><td valign="top">{#_order_service__item1Receive#}{*IntelliForex Software Package*}</td>
		<td valign="top"><img src="images/arrow_orange.gif" vspace="2" align="top" />&nbsp;</td><td valign="top">{#_order_service__item2Receive#}{*Live Streaming Quotes*}</td>
	</tr><tr>
		<td valign="top"><img src="images/arrow_orange.gif" vspace="2" align="top" />&nbsp;</td><td valign="top">{#_order_service__item3Receive#}{*E-mail Alerts with Charts and Forecasts*}</td>
		<td valign="top"><img src="images/arrow_orange.gif" vspace="2" align="top" />&nbsp;</td><td valign="top">{#_order_service__item4Receive#}{*Real-Time Forex Charts*}</td>
	</tr><tr>
		<td valign="top"><img src="images/arrow_orange.gif" vspace="2" align="top" />&nbsp;</td><td valign="top">{#_order_service__item5Receive#}{*Trend Forecasts for 5 Major Currency Pairs (2-6 days ahead)*}</td>
		<td valign="top"><img src="images/arrow_orange.gif" vspace="2" align="top" />&nbsp;</td><td valign="top">{#_order_service__item6Receive#}{*Integrated Fundamental Events and Indicators*}</td>
	</tr>
	</table>

 <br>
     <span>{#_order_service__msgAttention#}{*There is NO SETUP FEE and NO HIDDEN CHARGES. Your subscription will NOT automatically renew upon expiration.*}</span>
     <br><br>

  <table width="100%"  cellpadding="1" cellspacing="1">
  	<tr>
		<td class="theader" colspan="2">&nbsp;{#_order_service__msgSubscription#}{*Subscription*}</td>
		<td  class="theader">{#_order_service__msgRegularRate#}{*Regular rate*}</td>

		<td
		{if $lang=="ru"}
		style="display:none"
		{/if}
		 class="theader">{#_order_service__msgDiscountRate#}{*Discounted rate*}</td>
		<td class="theader"><nobr>{#_order_service__msgPerformance#}{*Performance*} <a href="index.php?p=rates&s=guarantee">{#_order_service__linkGuarantee#}{*guarantee*}</a></nobr></td>
	</tr>
   {foreach key="itr" from=$Order->getServicesData() item=service}
        <tr>
			<td width="40"
			{if $itr==0 || $itr==2 || $itr==4}
				class="darkRow"
			{/if}
			><div
			 {if $itr==0}
				style="display: none;"
			{/if}
			><input name="service" type="radio" value="paypal" onClick="javascript:setSubscrparams();"
			{* {if ($service.price=='' && $smarty.get.s=='trial') || ($smarty.get.s=='subscribe' && $itr==1)}
				checked
			{/if} *}
			{if $itr==1}
				checked
			{/if}
			></div></td>
			<td width="160"
			{if $itr==0 || $itr==2 || $itr==4}
				class="darkRow"
			{/if}
			>


			 {if $itr==0}
				 <b><a href="#" onClick="javascript:trialLink();" class="fakeLink">{$service.time}</a></b>
			{else}
				{$service.time}
			{/if}


				{if $service.time_units=="M"}
					{if $service.time==1}
				 	month
				 	{else}
				 	months
				 	{/if}
				{elseif $service.time_units=="D"}
					days
				{/if}

			<input type="hidden" value="{$service.time}" id="time{$itr}" />
			<input type="hidden" value="{$service.invoice}" id="invoice{$itr}" />
			<input type="hidden" value="{$service.time_units}" id="units{$itr}" /></td>
			<input type="hidden" value="{$service.name}" id="name{$itr}" /></td>

			<td
			{if $lang=="ru"}
			style="display:none"
			{/if}
			{if $itr==0 || $itr==2 || $itr==4}
				class="darkRow"
			{/if}
			>
			<span class="banThrough">${$service.price}</span><input type="hidden" value="{$service.fprice}" id="price{$itr}" /></td>
				<td
				{if $itr==0 || $itr==2 || $itr==4}
					class="darkRow"
				{/if}
				>{if $service.discount!='FREE'}{$curr_pre}{/if}{$service.discount}{if $service.discount!='FREE'} {$curr_post}{/if}<input type="hidden" value="{$service.discount}" id="discount{$itr}" /></td>

			<td width="100"
			{if $itr==0 || $itr==2 || $itr==4}
				class="darkRow"
			{/if}
			>
			{if $service.guarantee==1}
			    <a href="index.php?p=rates&s=guarantee" title="{#_order_service__msgGuaranteeDetails#}{*View guarantee details*}"><img src="images/icon_yes.gif" border="0" /></a>
			{else}
				<img src="images/icon_no.gif" border="0" />
			{/if}
			</td>
		</tr>
   {/foreach}
  </table>

 <br>

<table border="0" width="100%" cellpadding="1" cellspacing="1">
<tr>
	<td class="theader" colspan="3">&nbsp;{#_order_service__msgPaymentMethod#}{*Payment method*}</td>
</tr>
<tr>
	<td class="darkRow" width="40"><input name="payment" type="radio" value="paypal" checked></td><td width="160" class="darkRow"><img src="images/paypal.gif" align="middle" /></td><td class="darkRow">{#_order_service__msgPayPal#}{*Pay using your PayPal account or credit card*} &nbsp;&nbsp;&nbsp;</td>
</tr>
<tr style="display: none;">
	<td><input name="payment" type="radio" value="google" disabled></td><td></td><td class="darkRow" align="center">{#_order_service__msgGoogleCheckOut#}{*Pay by credit card using Google Checkout*}</td>
</tr>
<tr style="display: none;">
	<td class="darkRow"><input name="payment" type="radio" value="cheque" disabled>&nbsp;</td><td class="darkRow"></td><td class="darkRow" align="center">{#_order_service__msgCheck#}{*Send a check or money order*}</td>
</tr>
</table>
<table border="0" width="100%" cellpadding="1" cellspacing="1">
<tr>
	<td width="40"><br><input name="agreement" id="agreement" type="checkbox" value="ON">&nbsp;</td>
	<td><br>{#_order_service__msgAgree#}I AGREE to the <a target="_blank" href="index.php?p=eula">{#_order_service__msgAgreement#}{*End-User License and Subscription Agreement*}</a> {#_order_service__msgRisk#}{*and I fully understand the risks involved with Forex Trading as outlined in the*} <a target="_blank" href="index.php?p=rd">{#_order_service__linkRisk#}{*Risk Disclaimer*}</a>
	</td>

</tr>
</table>
<br>

<input type="hidden" id="authorized" value="{$Staff->Login()}">
<input type="hidden" id="isTrial" value="{$Staff->isTrialFinished()}">
<input type="hidden" id="isCap" value="{$smarty.get.cap}">
<div id="formCode">{$Order->inputsArr[0]}</div>
<div id="submitPayment">
	<input type="button" class="button" value="{#_order_service__btnContinue#}{*Continue*}" name="formSubmit" onclick="javascript:formSubmit('pay')" />
</div>
<div id="submitTrial">
	<input type="button" class="button" value="{#_order_service__btnContinue#}{*Continue*}" name="formSubmit" onclick="javascript:formSubmit('try')" />
</div>
<div id="submitUnauthorized">
	<input type="button" class="button" value="{#_order_service__btnContinue#}{*Continue*}" name="formSubmit" onclick="javascript:formSubmit('auth')" />
</div>


<script type="text/javascript">
 {literal}
  var subMenuPage;
  var GETcap = document.getElementById("isCap").value;
  var selectedService;
  var loggedIn = false;
  var isTrial = false;
  if (document.getElementById("authorized").value!="") loggedIn = true;
  if (document.getElementById("isTrial").value=="") isTrial = true;

function formSubmit(butType){
	//if(!loggedIn) alert("Please Sign-Up first or Sign-In if you have already Signed-Up.");
  	if (butType=="pay") {
	  	if(!document.getElementById('agreement').checked){
		 {/literal}
	      alert("{#_order_service__msgMustAgree#}{*You must agree to the Terms and Conditions of End-User License and Subscription Agreement.*}");
		  {literal}
	      return false;
	   	}
	   	document.paymentForm.submit();
   		return true;
	} else {
        window.location="index.php?p=rates&s="+subMenuPage+"&cap="+selectedService;
	}
 }


function redirect2PayPal(){
	//if(!loggedIn) alert("Please Sign-Up first or Sign-In if you have already Signed-Up.");
	if(GETcap!="") {
		document.getElementsByName('service')[GETcap].checked = true;
		setSubscrparams();
		document.paymentForm.submit();
	}
 }


  function trialLink(){
  	//if(loggedIn && isTrial) alert('You are already on a Free Trial.');
	//else if(loggedIn && !isTrial) alert('Your Free Trial has finished. Please Subscribe.');
	window.location = "index.php?p=rates&s=trial";
 }

 function  displaySubmitButton(butType){
 	 if (loggedIn) {
 	 		if(butType=="pay"){
               	document.getElementById("submitPayment").style.display = "block";
	      		document.getElementById("submitTrial").style.display = "none";
 	 		}
 	 		else {
 	 			document.getElementById("submitPayment").style.display = "none";
	      		document.getElementById("submitTrial").style.display = "block";
	      		subMenuPage = "status";
 	 		}
	      document.getElementById("submitUnauthorized").style.display = "none";
	}
	else {

		document.getElementById("submitUnauthorized").style.display = "block";
		document.getElementById("submitPayment").style.display = "none";
	 	document.getElementById("submitTrial").style.display = "none";
	 	subMenuPage = "signin"
	}
 }

 function setSubscrparams(){
  	var serviceID;
  	for (var i=0;i<document.getElementsByName('service').length;i++){

  		if(document.getElementsByName('service')[i].checked){
  			//if (i>0){ // if not free trial selected set price and display proper submit burtton
  				displaySubmitButton("pay");
  				document.paymentForm.elements['a3'].value = document.getElementById('price'+i).value;
  				document.paymentForm.elements['p3'].value = document.getElementById('time'+i).value;
  				document.paymentForm.elements['t3'].value = document.getElementById('units'+i).value;
  				document.paymentForm.elements['item_name'].value = document.getElementById('name'+i).value;
  				document.paymentForm.elements['invoice'].value = document.getElementById('invoice'+i).value;
  				selectedService = i; //set selected service var for not logged in users
  			//} else {
                //displaySubmitButton("try");
  			//}
  		} else {
  			displaySubmitButton("pay");
  			//document.getElementsByName('service')[i].checked = true;
  		}



  	}
  	//alert(document.paymentForm.elements['a3'].value+" "+document.paymentForm.elements['p3'].value+" "+document.paymentForm.elements['invoice'].value+" "+document.paymentForm.elements['t3'].value)
 }

 setSubscrparams();
 //alert(document.paymentForm.elements['a3'].value+" "+document.paymentForm.elements['p3'].value+" "+document.paymentForm.elements['invoice'].value+" "+document.paymentForm.elements['t3'].value)
 redirect2PayPal();

 {/literal}
 </script>





{$Order->setUser($Staff->UserID())}
